import {
  request2
} from 'network/request'

export function getDetail(iid) {
  return request2({
    // http://152.136.185.210:7878/api/m5/home/data?type=pop&page=1
    url: "/detail",
    params: {
      iid
    }
  })
}
//  详情页推荐
export function getRecommend() {
  return request2({
    // http://152.136.185.210:7878/api/m5/recommend
    url: "/recommend"
  })
}

// 导出创建的类

// 基本信息
export class GoodsInfo {
  constructor(itemInfo, columns, services) {
    this.title = itemInfo.title
    this.desc = itemInfo.desc
    this.oldPrice = itemInfo.oldPrice
    this.lowNowPrice = itemInfo.lowNowPrice
    this.discountDesc = itemInfo.discountDesc
    this.discountBgColor = itemInfo.discountBgColor
    this.columns = columns
    this.services = services
  }
}
// 2.商店信息
export class ShopInfo {
  constructor(shopInfo) {
    this.shopLogo = shopInfo.shopLogo // 店铺logo
    this.shopUrl = shopInfo.shopUrl // 店铺链接
    this.name = shopInfo.name // 店铺名称
    this.cSells = shopInfo.cSells // 销量
    this.cGoods = shopInfo.cGoods // 全部宝贝
    this.score = shopInfo.score // 评分
  }
}
// 3.参数信息
export class ParamsInfo {
  constructor(size, param) {
    // 尺码
    this.sizes = size.tables[0]
    // 参数
    this.params = param.set
  }
}
